import { Service } from "cl-admin";
import BaseService from "@/service/base";
@Service("Oa")
class Oa extends BaseService {
	// 全部列表
	list() {
		return Promise.resolve([
			/* 数据列表 */
		]);
	}
	// 分页列表
	page({ time, finish_time, ...args }) {
		let params = { ...args }
		if (time && time.length) {
			params.start_time = time[0];
			params.end_time = time[1];
		}
		if (finish_time && finish_time.length) {
			params.finish_start_time = finish_time[0];
			params.finish_end_time = finish_time[1];
		}
		return this.$get('/list', { params }).then(res => this.pagination(params, res))
	}
	// 新增
	add(data) {
		return Promise.resolve();
	}
	// 更新，包含 id
	update(data) {
		return Promise.resolve();
	}
	// 详情，传行 id
	info(params) {
		return this.$get('/details', { params })
	}
	// 删除，ids = [1, 2, 3]
	remove({ ids }) {
		return Promise.resolve();
	}
	// 审核
	audit(params) {
		return this.$post('/audit', params)
	}
	// 审核表-编辑
	edit(params) {
		return this.$post('/edit', params)
	}
	// 撤销
	cancel(params) {
		return this.$post('/cancel', params)
	}

	// oa审批人列表
	user(params) {
		return this.$get('/user', { params })
	}
	// 批量打款
	batchAudit(params) {
		return this.$post('/batchAudit', params)
	}

	// 评论
	comment(params) {
		return this.$post('/comment', params)

	}
}
export default Oa
